#ifndef _LOAD_CP_MESSAGE_HPP
#define _LOAD_CP_MESSAGE_HPP 1

#include "MacMessage.hpp"

namespace BFT
{
	namespace messages
	{
		class LoadCPMessage : public MacMessage
		{
			public:
			
			LoadCPMessage(boost::shared_ptr<char> _tok, int _tok_size, uint32_t _seq, uint32_t _sender);
			
			LoadCPMessage(boost::shared_ptr<char> _bytes, int _bytes_size);
			
			uint32_t getSendingReplica(); //inlined
			
			uint32_t getSequenceNumber(); //inlined
			
			boost::shared_ptr<char> getToken(); // inlined
			
			int getTokenSize(); //inlined
			
			boost::shared_ptr<char> getToken(int& _token_size); //inlined
			
			bool matches(boost::shared_ptr<VerifiedMessageBase> _other_vmb);
			
			void printInfo();
			
			protected:
			
			uint32_t token_size;
			boost::shared_ptr<char> token;
			
			uint32_t seqNo;
			
			private:
			
			static uint32_t computeSize(int _token_size);
			
		};
	
	inline uint32_t LoadCPMessage::getSendingReplica() {return getSender();}
	
	inline uint32_t LoadCPMessage::getSequenceNumber() {return seqNo;}
	
	inline boost::shared_ptr<char> LoadCPMessage::getToken() {return token;}
	
	inline boost::shared_ptr<char> LoadCPMessage::getToken(int& _token_size) {_token_size = token_size; return token;}
	
	inline int LoadCPMessage::getTokenSize() {return token_size;}	
				
	}
}

#endif
